import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/yb_chinese_text/yb_chinese_text.dart';

enum YBMiShuYiHuoFeedStatusPageType {
  YBMiShuYiHuoFeedStatusPageType_YiHuoShangJi,
  YBMiShuYiHuoFeedStatusPageType_YiYiShangJi,
}


class YBMiShuTongYiHuoFeedStausPage extends StatelessWidget {

  final String timeStr;
  final String statusStr;
  final String contentStr;
  final YBMiShuYiHuoFeedStatusPageType statusPageType;

  const YBMiShuTongYiHuoFeedStausPage({Key key, this.timeStr, this.statusStr, this.contentStr,this.statusPageType}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    print('---object-$statusStr--');
    Widget colorText;
    if (statusPageType == YBMiShuYiHuoFeedStatusPageType.YBMiShuYiHuoFeedStatusPageType_YiHuoShangJi) {
      if (!ObjectUtil.isEmptyString(statusStr)) {
        if (statusPageType == YBMiShuYiHuoFeedStatusPageType.YBMiShuYiHuoFeedStatusPageType_YiHuoShangJi) {
          if (int.parse(statusStr) == 1) {
            colorText = Container(
              child: Text(YBChineseText.workTaiYiFanKuiTitle??"", style: YBTextStyle.TextStyle47C20013,),
            );
          } else {
            colorText = Container(
              child: Text(YBChineseText.workTaiWeiFanKuiTitle??"", style: YBTextStyle.TextStyleFA323213,),
            );
          }
        }
      }
    } else if (statusPageType == YBMiShuYiHuoFeedStatusPageType.YBMiShuYiHuoFeedStatusPageType_YiYiShangJi) {
      if (!ObjectUtil.isEmptyString(statusStr)) {
        if (statusPageType == YBMiShuYiHuoFeedStatusPageType.YBMiShuYiHuoFeedStatusPageType_YiYiShangJi) {
          if (int.parse(statusStr) == 2) {
            colorText = Container(
              child: Text(YBChineseText.workTaiYiTongGuoTitle??"", style: YBTextStyle.TextStyle47C20013,),
            );
          } else if (int.parse(statusStr) == 1) {
            colorText = Container(
              child: Text(YBChineseText.workTaiYiBaoHuiTitle??"", style: YBTextStyle.TextStyleFA323213,),
            );
          } else if (int.parse(statusStr) == 0) {
            colorText = Container(
              child: Text(YBChineseText.workTaiShangJiDaiChuLiTitle??"", style: YBTextStyle.TextStyleFDB33313,),
            );
          }
        }
      }
    }else{

    }

    return  Column(
      children: [
        Container(
          child: InkWell(
            child: Padding(
              padding: EdgeInsets.only(left: YBTextStyle.adapterSize20,right: YBTextStyle.adapterSize20),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Container(
                    height: YBTextStyle.adapterSize12,
                  ),
                  Container(
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Container(
                          child: Text(timeStr??"",style: YBTextStyle.TextStyle1B1C1F15Medium,),
                        ),
                        colorText,
                      ],
                    ),
                  ),
                  Container(
                    height: YBTextStyle.adapterSize15,
                  ),
                  Container(
                    child: Text(contentStr??"",style: YBTextStyle.TextStyle71747A14,maxLines: 2,),
                  ),
                  Container(
                    height: YBTextStyle.adapterSize15,
                  ),
                ],
              ),
            ),
          ),
        ),
        Container(
          height: YBTextStyle.adapterSize5,
          color: YBColor.colorF5F5F7,
        )
      ],
    );
  }
}
